const express = require('express');
const router = express.Router();
const folderController = require('../controllers/folderController');
const upload = require('../config/multerConfig');

// 创建文件夹
router.post('/create', folderController.createFolder);

// 获取文件夹内容
router.get('/:folderId/:userId', folderController.getFolderContents);

// 重命名文件夹
router.put('/:folderId/rename', folderController.renameFolder);

// 删除文件夹
router.delete('/:folderId', folderController.deleteFolder);

// 移动文件夹
router.put('/:folderId/move', folderController.moveFolder);

// 下载文件夹
router.get('/download/:folderId/:userId', folderController.downloadFolder);

// 上传文件夹
router.post('/upload-folder', upload.array('files'), folderController.uploadFolder);

module.exports = router;